<template>
	<div>
		<div class="recommend-title">热销推荐</div>
		<ul>
			<router-link 
				class="item" 
				v-for="item of recommendList" 
				:key="item.id"
				:to="'/detail/' + item.id"
				tag="li"
			>
				<div class="item-img-wrap">
					<img 
						:src="item.imgUrl" 
						:alt="item.title" 
						class="item-img"
					>
				</div>
				<div class="item-info">
					<p class="item-title">{{item.title}}</p>
					<p class="item-desc">{{item.desc}}</p>
					<button class="item-button">查看样式</button>
				</div>
			</router-link>
		</ul>
	</div>
</template>

<script type="text/javascript">
	export default {
		props: {
			recommendList: Array
		},
		name: 'HomeRecommend',
		data: function(){
			return {
				
			}
		}
	}
</script>

<style lang="stylus" scoped>
	@import '~styles/mixins.styl'
	.recommend-title
		margin-top: .2rem;
		line-height: .8rem;
		background-color: #eee;
		text-indent: .2rem;
	.item
		display: flex;
		height: 1.9rem;
		padding: .1rem;
		border-bottom: 1px #eee solid;
		.item-img-wrap
			width: 1.7rem;
			height: 1.7rem;
			img
				width:100%;
				height: 100%;
		.item-info
			flex: 1;
			min-width: 0;
			padding-left: .2rem;
			.item-title
				font-size: .32rem;
				line-height: .54rem;
				color: #212121;
				font-weight: 400;
				ellipsis();
			.item-desc
				ellipsis()
				line-height: .4rem;
				color: #616161;
			.item-button
				background-color: #00bcd4;
				border-radius: .06rem;
				color: #fff;
				padding: .1rem;
				margin-top: .2rem;
</style>